package com.ruoyi.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.T07;
import com.ruoyi.service.IT07Service;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 个人历史记录Controller
 * 
 * @author ruoyi
 * @date 2024-07-30
 */
@RestController
@RequestMapping("/queryrecord/T07")
public class T07Controller extends BaseController
{
    @Autowired
    private IT07Service t07Service;

    /**
     * 查询个人历史记录列表
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:list')")
    @GetMapping("/list")
    public TableDataInfo list(T07 t07)
    {
        startPage();
        List<T07> list = t07Service.selectT07List(t07);
        return getDataTable(list);
    }

    /**
     * 导出个人历史记录列表
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:export')")
    @Log(title = "个人历史记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, T07 t07)
    {
        List<T07> list = t07Service.selectT07List(t07);
        ExcelUtil<T07> util = new ExcelUtil<T07>(T07.class);
        util.exportExcel(response, list, "个人历史记录数据");
    }

    /**
     * 获取个人历史记录详细信息
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:query')")
    @GetMapping(value = "/{F0701}")
    public AjaxResult getInfo(@PathVariable("F0701") Long F0701)
    {
        return success(t07Service.selectT07ByF0701(F0701));
    }

    /**
     * 新增个人历史记录
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:add')")
    @Log(title = "个人历史记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody T07 t07)
    {
        return toAjax(t07Service.insertT07(t07));
    }

    /**
     * 修改个人历史记录
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:edit')")
    @Log(title = "个人历史记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody T07 t07)
    {
        return toAjax(t07Service.updateT07(t07));
    }

    /**
     * 删除个人历史记录
     */
    @PreAuthorize("@ss.hasPermi('queryrecord:T07:remove')")
    @Log(title = "个人历史记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{F0701s}")
    public AjaxResult remove(@PathVariable Long[] F0701s)
    {
        return toAjax(t07Service.deleteT07ByF0701s(F0701s));
    }
}
